

*********************************************
**************** Figure 2 *******************
*********************************************


use "/Users/andrearobbett/Dropbox/Projects/Responsible_Majorities/April2018Data/Robbett_Matthews_Data.dta", clear

collapse Response, by(globalid Voice Democrat Copartisans)

gen gap_mean =.
gen gap_se = .



ttest Response if Copartisans == 6 & Voice==1, by(Democrat)

replace gap_mean =`r(mu_2)' - `r(mu_1)' if Copartisans == 6 & Voice==1
replace gap_se =`r(se)' if Copartisans == 6 & Voice==1

ttest Response if Copartisans == 9 & Voice==1, by(Democrat)

replace gap_mean =`r(mu_2)' - `r(mu_1)' if Copartisans == 9 & Voice==1
replace gap_se =`r(se)' if Copartisans == 9 & Voice==1

ttest Response if Copartisans == 12 & Voice==1, by(Democrat)

replace gap_mean =`r(mu_2)' - `r(mu_1)' if Copartisans == 12 & Voice==1
replace gap_se =`r(se)' if Copartisans == 12 & Voice==1

ttest Response if Copartisans == 6 & Voice==0, by(Democrat)

replace gap_mean =`r(mu_2)' - `r(mu_1)' if Copartisans == 6 & Voice==0
replace gap_se =`r(se)' if Copartisans == 6 & Voice==0

ttest Response if Copartisans == 9 & Voice==0, by(Democrat)

replace gap_mean =`r(mu_2)' - `r(mu_1)' if Copartisans == 9 & Voice==0
replace gap_se =`r(se)' if Copartisans == 9 & Voice==0

ttest Response if Copartisans == 12 & Voice==0, by(Democrat)

replace gap_mean =`r(mu_2)' - `r(mu_1)' if Copartisans == 12 & Voice==0
replace gap_se =`r(se)' if Copartisans == 12 & Voice==0


collapse gap_mean gap_se, by(Voice Copartisans)

tabstat gap_mean if Voice==1, by(Copartisans)
tabstat gap_se if Voice==1, by(Copartisans)
tabstat gap_mean if Voice==0, by(Copartisans)
tabstat gap_se if Voice==0, by(Copartisans)

gen se_l = gap_mean - gap_se
gen se_u = gap_mean + gap_se

gen treatment = 1
replace treatment = 2 if Copartisans == 9
replace treatment = 3 if Copartisans == 12
twoway (bar gap_mean treatment if Voice==0, fcolor(eltblue) lcolor(gs15) barwidth(0.6)) (rcap se_l se_u treatment if Voice==0, lcolor(gs6) msize(large)), /*
	*/ ytitle(Difference in Democratic and Republican Response) xtitle(Co-partisans) ylabel(0(.05).25) xlabel(1 "6" 2 "9" 3 "12") legend(order(1 "Partisan Gap" 2 "Standard Error Bars")) legend(off) graphregion(fcolor(white)) xsize(4) ysize(3) title(Partisan Gap by Co-partisans (Private))
	
twoway (bar gap_mean treatment if Voice==1, fcolor(eltblue) lcolor(gs15) barwidth(0.6)) (rcap se_l se_u treatment if Voice==1, lcolor(gs6) msize(large)), /*
	*/ ytitle(Difference in Democratic and Republican Response) xtitle(Co-partisans) ylabel(0(.05).25) xlabel(1 "6" 2 "9" 3 "12") legend(order(1 "Partisan Gap" 2 "Standard Error Bars")) legend(off) graphregion(fcolor(white)) xsize(4) ysize(3) title(Partisan Gap by Co-partisans (Shared))

clear

	
*********************************************
**************** Table 1 *******************
*********************************************

use "/Users/andrearobbett/Dropbox/Projects/Responsible_Majorities/April2018Data/Robbett_Matthews_Data.dta", clear
	

label variable Voice "Shared"
label variable College_Or_More "College Or More"
label variable Democrat_x_College "(Democrat)x(College Or More)"
label variable Non_White "Non-White"
label variable Democrat_x_NonWhite "(Democrat)x(Non-White)"
label variable Twelve_Coparts "Population Majority"
label variable Voice_x_Democrat "(Shared)x(Democrat)"
label variable Voice_x_Twelve_Coparts "(Shared)x(Population Majority)"
label variable Twelve_Coparts_x_Democrat "(Population Majority)x(Democrat)"
label variable Voice_x_Twelve_Cop_x_Democrat "(Shared)x(Population Majority)x(Democrat)"
label variable Majority "Voter Majority"
label variable Maj_x_Democrat "(Voter Majority)x(Democrat)"
label variable Maj_x_Voice "(Voter Majority)x(Shared)"
label variable Maj_x_Voice_x_Democrat "(Shared)x(Voter Majority)x(Democrat)"
	

eststo clear

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite, cluster(globalid)

eststo: reg Response Democrat Voice Voice_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite, cluster(globalid)

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite, cluster(globalid)

esttab, se ar2 label title(Partisan Gap) addnote("Standard errors clustered by individual.") mtitles("" "" "" "") star(* 0.10 ** 0.05 *** 0.01)



*********************************************
************ Figures 3 and 4*****************
*********************************************

use "/Users/andrearobbett/Dropbox/Projects/Responsible_Majorities/April2018Data/Robbett_Matthews_Data.dta", clear

ssc install grstyle, replace
 
label define info 0 "Private" 1 "Shared"
label values Voice info
label define party 0 "Republican" 1 "Democrat"
label values Democrat party
label define edu 0 "Less Than College" 1 "College Or More"
label values College_Or_More edu


reg Response i.Democrat i.Voice i.Twelve_Coparts i.College_Or_More i.Non_White i.Voice#i.Democrat i.Voice#i.Twelve_Coparts /*
	*/ i.Twelve_Coparts#i.Democrat i.Voice#i.Twelve_Coparts#i.Democrat i.Majority i.Majority#i.Democrat i.Majority#i.Voice i.Voice#i.Majority#i.Democrat/*
	*/ i.Democrat#i.College_Or_More i.Democrat#i.Non_White, cluster(globalid)
*
label variable Democrat "Affiliation"
label variable Twelve_Coparts "Population Majority"


margins Democrat, at (Twelve_Coparts=(0 1) Voice=(0 1) )
grstyle init
grstyle set plain
marginsplot, level(95) by(Voice) yline(0.56, lcolor(green)) ytitle(Scaled Response) byop(title("Predictions on Partisanship of Response")) plot1opts(msymbol(Oh) lcolor(red)) plot2opts(msymbol(Dh) lcolor(blue))


margins Democrat, at (Twelve_Coparts=(0 1) College_Or_More=(0 1) Voice=(1))
grstyle init
grstyle set plain
marginsplot, level(95) by(College_Or_More) yline(0.56, lcolor(green)) ytitle(Scaled Response) byopt(title("Predictions on Partisanship of Response, Shared Information")) plot1opts(msymbol(Oh) lcolor(red)) plot2opts(msymbol(Dh) lcolor(blue))



*********************************************
**************** Table A1 *******************
*********************************************


use "/Users/andrearobbett/Dropbox/Projects/Responsible_Majorities/April2018Data/Robbett_Matthews_Data.dta", clear
	

label variable Voice "Shared"
label variable College_Or_More "College Or More"
label variable Democrat_x_College "(Democrat)x(College Or More)"
label variable Non_White "Non-White"
label variable Democrat_x_NonWhite "(Democrat)x(Non-White)"
label variable Twelve_Coparts "Population Majority"
label variable Voice_x_Democrat "(Shared)x(Democrat)"
label variable Voice_x_Twelve_Coparts "(Shared)x(Population Majority)"
label variable Twelve_Coparts_x_Democrat "(Population Majority)x(Democrat)"
label variable Voice_x_Twelve_Cop_x_Democrat "(Shared)x(Population Majority)x(Democrat)"
label variable Majority "Voter Majority"
label variable Maj_x_Democrat "(Voter Majority)x(Democrat)"
label variable Maj_x_Voice "(Voter Majority)x(Shared)"
label variable Maj_x_Voice_x_Democrat "(Shared)x(Voter Majority)x(Democrat)"
	
eststo clear

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite if Question=="Immigrants", cluster(globalid)

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite if Question=="Unemployment", cluster(globalid)

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite if Question=="Insured", cluster(globalid)

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite if Question=="Dow", cluster(globalid)

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite if Question=="Approval", cluster(globalid)

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite if Question=="Climate", cluster(globalid)

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite if Question=="Bills", cluster(globalid)

eststo: reg Response Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite if Question=="CCI", cluster(globalid)


label variable Democrat "Democrat"

esttab, /*
	*/ replace cells(b(star fmt(%9.3f)) se(par)) stats(Control_Mean R_2 N, fmt(%9.3f %9.0g) /*
	*/ labels("Control Mean" "R2" "Observations")) /*
	*/ order (Democrat Voice Twelve_Coparts Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Voice_x_Twelve_Cop_x_Democrat /*
	*/ Majority Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite) /*
	*/ legend label collabels(none) varlabels(_cons Constant) /*
	*/ varwidth(50) mtitles ("Q1" "Q2" "Q3" "Q4" "Q5" "Q6" "Q7" "Q8") /*
	*/ title(Partisan Gap: Question by Question) addnote("Q1: Immigration, Q2: Unemployment, Q3: Health Insurance, Q4: Dow, Q5: Approval, Q6: Climate, Q7: Bills, Q8: Consumer Confidence") /*
	*/ star (* 0.10 ** 0.05 *** 0.01)


*********************************************
**************** Table A2 *******************
*********************************************
use "/Users/andrearobbett/Dropbox/Projects/Responsible_Majorities/April2018Data/Robbett_Matthews_Data.dta", clear

eststo clear

gen PopComp = Copartisans/18
gen PopComp1 = 0
replace PopComp1 = .5 if Copartisans == 9
replace PopComp1 = 1 if Copartisans == 12

gen Voice_PopComp = Voice*PopComp
gen PopComp_Democrat = PopComp*Democrat
gen Voice_PopComp_Democrat = Voice*PopComp*Democrat

label variable PopComp "Co-partisan Proportion"
label variable PopComp_Democrat "(Co-partisan Proportion) x (Democrat)"
label variable Voice_PopComp "(Co-partisan Proportion) x (Shared)"
label variable Voice_PopComp_Democrat "(Co-partisan Proportion) x (Shared) x (Democrat)"
label variable Voice "Shared"
label variable College_Or_More "College Or More"
label variable Democrat_x_College "(Democrat)x(College Or More)"
label variable Non_White "Non-White"
label variable Democrat_x_NonWhite "(Democrat)x(Non-White)"
label variable Twelve_Coparts "Population Majority"
label variable Voice_x_Democrat "(Shared)x(Democrat)"
label variable Voice_x_Twelve_Coparts "(Shared)x(Population Majority)"
label variable Twelve_Coparts_x_Democrat "(Population Majority)x(Democrat)"
label variable Voice_x_Twelve_Cop_x_Democrat "(Shared)x(Population Majority)x(Democrat)"
label variable Majority "Voter Majority"
label variable Maj_x_Democrat "(Voter Majority)x(Democrat)"
label variable Maj_x_Voice "(Voter Majority)x(Shared)"
label variable Maj_x_Voice_x_Democrat "(Shared)x(Voter Majority)x(Democrat)"
	

gen Voice_PopComp1 = Voice*PopComp1
gen PopComp1_Democrat = PopComp1*Democrat
gen Voice_PopComp1_Democrat = Voice*PopComp1*Democrat

eststo: reg Response Democrat Voice PopComp Voice_x_Democrat Voice_PopComp PopComp_Democrat Voice_PopComp_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite, cluster(globalid)

gen VoteComp = CopartisanVoters/9
gen VoteComp_Democrat = VoteComp*Democrat
gen Voice_VoteComp = Voice*VoteComp
gen Voice_VoteComp_Democrat = Voice*VoteComp*Democrat

label variable VoteComp "Co-partisan Voter Proportion"
label variable VoteComp_Democrat "(Co-partisan Voter Proportion) x (Democrat)"
label variable Voice_VoteComp "(Co-partisan Voter Proportion) x (Shared)"
label variable Voice_VoteComp_Democrat "(Co-partisan Voter Proportion) x (Shared) x (Democrat)"


eststo: reg Response Democrat Voice Voice_x_Democrat VoteComp VoteComp_Democrat Voice_VoteComp Voice_VoteComp_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite, cluster(globalid)

eststo: reg Response Democrat Voice PopComp Voice_PopComp PopComp_Democrat Voice_PopComp_Democrat Voice_x_Democrat VoteComp VoteComp_Democrat Voice_VoteComp Voice_VoteComp_Democrat College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite, cluster(globalid)


esttab, replace  se ar2 label title(Partisan Gap with Continuous Population and Voter Composition Variables) addnote("Standard errors clustered by individual.") mtitles("" "" "" "") star(* 0.10 ** 0.05 *** 0.01)


*********************************************
**************** Table A3 *******************
*********************************************


gen Twelve_Coparts_x_Maj = Twelve_Coparts*Majority
gen Dem_x_Twelve_Coparts_x_Majority = Democrat*Twelve_Coparts*Majority
gen Twelve_Coparts_x_Voice_x_Maj = Voice*Twelve_Coparts*Majority
gen Dem_Twelve_Coparts_x_Voice_x_Maj = Democrat*Voice*Twelve_Coparts*Majority


label variable Twelve_Coparts_x_Maj "(Population Majority) x (Voter Majority)"
label variable Dem_x_Twelve_Coparts_x_Majority "(Population Majority) x (Voter Majority) x (Democrat)"
label variable Twelve_Coparts_x_Voice_x_Maj "(Shared) x (Population Majority) x (Voter Majority)"
label variable Dem_Twelve_Coparts_x_Voice_x_Maj "(Shared) x (Population Majority) x (Voter Majority) x (Democrat)"

est clear


eststo: reg Response Democrat Voice Twelve_Coparts Majority Voice_x_Democrat Voice_x_Twelve_Coparts Twelve_Coparts_x_Democrat Twelve_Coparts_x_Maj  Maj_x_Democrat Maj_x_Voice Maj_x_Voice_x_Democrat Dem_x_Twelve_Coparts_x_Maj Voice_x_Twelve_Cop_x_Democrat Twelve_Coparts_x_Voice_x_Maj Dem_Twelve_Coparts_x_Voice_x_Maj College_Or_More Democrat_x_College Non_White Democrat_x_NonWhite, cluster(globalid)


esttab, replace  se ar2 label title(Partisan Gap with Fully Saturated Model) addnote("Standard errors clustered by individual.") mtitles("" "" "" "") star(* 0.10 ** 0.05 *** 0.01)



